package com.ala4.oxcafe.entity;

import com.ala4.oxcafe.core.entity.BaseEntity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 部门信息
 *
 * @author PING
 * @date 2025/8/12 20:57
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("dept_info")
@Schema(description = "部门信息")
public class DeptInfo extends BaseEntity {

    @Schema(description = "主键id")
    @TableId(value = "id", type = IdType.INPUT)
    @NotNull(message = "ID不能为空", groups = {Update.class})
    private Long id;

    @Schema(description = "部门名称")
    @NotNull(message = "部门名称不能为空", groups = {Create.class, Update.class})
    @NotEmpty(message = "部门名称不能为空", groups = {Create.class, Update.class})
    private String deptName;

    @Schema(description = "父部门ID")
    @NotNull(message = "父部门ID不能为空", groups = {Create.class})
    private Long parentId;

    @Schema(description = "显示顺序")
    private Integer deptSort;

    @Schema(description = "负责人")
    private String leader;

    @Schema(description = "联系电话")
    private String phone;

    @Schema(description = "邮箱")
    private String email;

    @Schema(description = "部门状态（0正常 1停用）")
    @NotNull(message = "部门状态不能为空", groups = {Create.class, Update.class})
    private Integer status;


    public interface Create {
    }

    public interface Update {
    }
}
